package com.resign.carl.command.example2.api.impl;

import com.resign.carl.command.example1.api.Command;
import com.resign.carl.command.example1.api.impl.GarageDoor;

/**
 * Created by carl.zhao on 2016/6/15.
 */
public class GarageDoorCloseCommand implements Command {

    private GarageDoor garageDoor;

    public GarageDoorCloseCommand(GarageDoor garageDoor){
        this.garageDoor = garageDoor;
    }

    @Override
    public void execute() {
        garageDoor.close();
    }

    @Override
    public void undo() {
        garageDoor.open();
    }
}
